package cn.pojo;

import java.io.Serializable;
import java.sql.Timestamp;

import cn.util.Commons;

/**
 * user 实体类 Sat Nov 03 11:35:15 CST 2018 qiange
 */

public class User implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 6435511597275982447L;
	private Long id;
	private String userCode;
	private String userName;
	private String userPassword;
	private Integer gender;
	private Timestamp birthday;
	private String phone;
	private String address;
	private Integer userRole;
	private Long createdBy;
	private Timestamp creationDate;
	private Long modifyBy;
	private Timestamp modifyDate;
	private String picpath;
	private String resume;
	private Integer age;// 年龄
	private Role role;// 根据userRole获得的角色对象
	// select * from smbms_role where id = userRole;

	public void setId(Long id) {
		this.id = id;
	}

	public Long getId() {
		return id;
	}

	public void setUserCode(String userCode) {
		this.userCode = userCode;
	}

	public String getUserCode() {
		return userCode;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserPassword(String userPassword) {
		this.userPassword = userPassword;
	}

	public String getUserPassword() {
		return userPassword;
	}

	public void setGender(Integer gender) {
		this.gender = gender;
	}

	public Integer getGender() {
		return gender;
	}

	public void setBirthday(Timestamp birthday) {
		this.birthday = birthday;
	}

	public Timestamp getBirthday() {
		return birthday;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getPhone() {
		return phone;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getAddress() {
		return address;
	}

	public void setUserRole(Integer userRole) {
		this.userRole = userRole;
	}

	public Integer getUserRole() {
		return userRole;
	}

	public void setCreatedBy(Long createdBy) {
		this.createdBy = createdBy;
	}

	public Long getCreatedBy() {
		return createdBy;
	}

	public void setCreationDate(Timestamp creationDate) {
		this.creationDate = creationDate;
	}

	public Timestamp getCreationDate() {
		return creationDate;
	}

	public void setModifyBy(Long modifyBy) {
		this.modifyBy = modifyBy;
	}

	public Long getModifyBy() {
		return modifyBy;
	}

	public void setModifyDate(Timestamp modifyDate) {
		this.modifyDate = modifyDate;
	}

	public Timestamp getModifyDate() {
		return modifyDate;
	}

	public void setPicpath(String picpath) {
		this.picpath = picpath;
	}

	public String getPicpath() {
		return picpath;
	}

	public void setResume(String resume) {
		this.resume = resume;
	}

	public String getResume() {
		return resume;
	}

	public Integer getAge() {
		return Commons.converteDateToAge(birthday);
	}

	public void setAge(Integer age) {
		this.age = age;
	}

	public Role getRole() {
		return role;
	}

	public void setRole(Role role) {
		this.role = role;
	}

	@Override
	public String toString() {
		return "User [id=" + id + ", userCode=" + userCode + ", userName=" + userName + ", userPassword=" + userPassword
				+ ", gender=" + gender + ", birthday=" + birthday + ", phone=" + phone + ", address=" + address
				+ ", userRole=" + userRole + ", createdBy=" + createdBy + ", creationDate=" + creationDate
				+ ", modifyBy=" + modifyBy + ", modifyDate=" + modifyDate + ", picpath=" + picpath + ", resume="
				+ resume + ", age=" + age + ", role=" + role + "]";
	}
}
